// const CompressionPlugin = require("compression-webpack-plugin");

module.exports = {
  runtimeCompiler: true,
  //关闭eslint
  lintOnSave: false,
  publicPath: process.env.NODE_ENV === "production" ? "./" : "/",
  assetsDir: "static",
  productionSourceMap: false,
  outputDir: "dist",
  // configureWebpack: config => {
  //   if (process.env.NODE_ENV === "production") {
  //     return {
  //       plugins: [
  //         new CompressionPlugin({
  //           // test: /\.js$|\.html$|\.css/,
  //           test: /\.(js|css|svg|woff|ttf|json|html)$/,
  //           threshold: 10240,
  //           deleteOriginalAssets: false
  //         })
  //       ]
  //     };
  //   }
  // },
  css: {
    loaderOptions: {
      less: {
        lessOptions: {
          modifyVars: {
            'primary-color': '#1DA57A',
            'link-color': '#1DA57A',
            'border-radius-base': '1px',
          },
          javascriptEnabled: true,
        },
      },
    },
  },
  devServer: {
    host: "0.0.0.0",
    port: 8001, // 端口号
    https: false, // https:{type:Boolean}
    open: true, //配置自动启动浏览器  http://XXX.XXX.X.XX:7071/rest/XXX/
    hotOnly: true // 热更新
  },

};
